<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="收房合同编号" prop="sfContractNo" label-width="30">
        <el-input
          v-model="queryParams.sfContractNo"
          placeholder="请输入收房合同编号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item label="业主姓名" prop="ownerName">
        <el-input
          v-model="queryParams.ownerName"
          placeholder="请输入业主姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <br>
      <el-form-item label="小区名称" prop="premiseName">
        <el-input
          v-model="queryParams.premiseName"
          placeholder="请输入小区名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item label="合同录入时间" prop="conInfoTime" label-width="30">
        <el-date-picker clearable size="small"
                        v-model="queryParams.conInfoTime"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="选择合同录入时间，">
        </el-date-picker>
        至
        <el-date-picker clearable size="small"
                        v-model="queryParams.leaseEndTime"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="选择合同录入时间，">
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search"  @click="handleQuery">搜索</el-button>

        <el-button type="primary" icon="el-icon-refresh" plain @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">

      <el-table v-loading="loading" :data="contractList">
        <el-table-column label="合同编号" align="center" prop="sfContractNo" />
        <el-table-column label="小区" align="center" prop="premiseName" />
        <el-table-column label="电话" align="center" prop="signUserMobile" />
        <el-table-column label="起租日期" align="center" prop="leaseStartTime" width="180">

        </el-table-column>
        <el-table-column label="结束日期" align="center" prop="leaseEndTime" width="180">

        </el-table-column>

        <el-table-column label="录入时间" align="center" prop="reserve3" width="180">

        </el-table-column>
        <el-table-column label="审核日期" align="center" prop="reserve4" width="180">

        </el-table-column>
        <el-table-column label="业主" align="center" prop="ownerName" />

        <el-table-column label="操作人" align="center" prop="reserve5" />

        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
          <el-upload
            class="avatar-uploader"
            action="http://localhost/dev-api/home/contract/csv"
            :show-file-list="false">
            收房协议录入
          </el-upload>
        </el-table-column>
      </el-table>



      <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    </el-row>
  </div>
</template>

<script>
  import { listContract} from "@/api/home/contract";

  export default {
    name: "Contract",
    data() {
      return {
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 【请填写功能名称】表格数据
        contractList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          sfContractNo: null,
          premiseName: null,
          ownerName: null,
          conInfoTime: null,
          leaseEndTime: null,
        },
        // 表单参数
        form: {
          sfContractNo: null,
          premiseName: null,
          ownerName: null,
          conInfoTime: null,
          leaseEndTime: null,
        },
      };
    },
    created() {
      this.getList();
    },
    methods: {
      /** 查询【请填写功能名称】列表 */
      getList() {
        this.loading = true;
        listContract(this.queryParams).then(response => {
          this.contractList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          id: null,
          sfContractNo: null,
          outContractNo: null,
          lastContractId: null,
          lastContractNo: null,
          businessId: null,
          deptId: null,
          deptNo: null,
          premiseName: null,
          houseId: null,
          houseName: null,
          houseType: null,
          houseZsNo: null,
          cqAddress: null,
          ownerId: null,
          ownerName: null,
          signWithOwner: null,
          ownerIdCard: null,
          ownerMobile: null,
          ownerContactAddress: null,
          signUserName: null,
          signUserIdCard: null,
          signUserMobile: null,
          signUserEmergencyPhone: null,
          bankCard: null,
          bankUserName: null,
          bankUserIdCard: null,
          bankId: null,
          bankName: null,
          bankOpen: null,
          leaseStartTime: null,
          leaseEndTime: null,
          monthRent: null,
          depositMoney: null,
          depositType: null,
          paymentType: null,
          conSignTime: null,
          conInfoTime: null,
          conAudTime: null,
          operId: null,
          sfUserId: null,
          sfUserName: null,
          status: 0,
          xyStatus: 0,
          sfLoanFlg: null,
          freezeStatus: 0,
          accountType: null,
          bankCardNumber: null,
          accountName: null,
          bankBranchCodeLh: null,
          bankAccountProvince: null,
          remark: null,
          reserve1: null,
          reserve2: null,
          reserve3: null,
          reserve4: null,
          reserve5: null,
          delFlg: null,
          createUserid: null,
          createTime: null,
          updateUserid: null,
          updateTime: null,
          houseLeaseType: null
        };
        this.resetForm("form");
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.handleQuery();
      }
    }
  };
</script>

<style scoped>

</style>
